<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // const reg = /^abc/
        // const str1 = "abc"
        // const str2 = "aaa"
        // const str3 = "a11"
        // console.log(reg.test(str1));//true
        // console.log(reg.test(str2));//false
        // console.log(reg.test(str3));//false,true

        
        // const reg = /abc$/
        // const str1 = "abc"
        // const str2 = "aaa"
        // const str3 = "a11"
        // console.log(reg.test(str1));//true
        // console.log(reg.test(str2));//false
        // console.log(reg.test(str3));//false



        // const reg = /^a\dc$/
        const reg = /^a\wc$/
        const str1 = "a1c"
        const str2 = "aaabbbccc"
        const str3 = "a11c"
        const str4 = "a1b1c"
        const str5 = "a8c"
        console.log(reg.test(str1));//true
        console.log(reg.test(str2));//false
        console.log(reg.test(str3));//false/true
        console.log(reg.test(str4));//false
        console.log(reg.test(str5));//true

    </script>
</body>
</html>